package com.ccl.iot.dialogs;

import android.app.Dialog;
import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

public abstract class CustomDialog extends Dialog {

    public CustomDialog(Context context, int style) {
        super(context, style);
        init();
    }

    private void init() {
        setContentView(getView());
        Window window = getWindow();

        WindowManager.LayoutParams params = window.getAttributes();

        params.gravity = Gravity.CENTER;

        window.setAttributes(params);
    }

    public abstract View getView();
}
